//
//  ST_MyPhotoCollectionCellModel.swift
//  btvideo
//
//  Created by mac on 2020/1/7.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit
import HandyJSON

class ST_MyPhotoCollectionCellModel: NSObject,HandyJSON {

    

    /**
     图片、视频 uuid key
     */
    var content_key = ""
//    remote id
    var id = 0
    
    /**
     状态(1:待审核,2:审核中,3:通过,4:拒绝)
     */
    var state = -7
    /**
    远程URL 图片 或 视频封面
    */
    var content = ""
    /**
       远程视频 URL
    */
    var video_url = ""
    /**
     视频时长
     */
    var duration = 0
//    排序值 暂不使用
//    var position = 0
    
    /**类型(1:视频,2:图片)
     */
    var type = 1
    
    var width = 0.cgFloat
    var height = 0.cgFloat
    
//    MARK: local
    
    var localImage:UIImage?
    
    var localVideoUrl:String?
    
    var uploadStatus:ST_DTChatUploadStatus = .success
    
    var uploadImageProgress = 0
    
    required override init() {
        super.init()
    }
    
    init(image:UIImage) {
        super.init()
        localImage = image
        content_key = UUID().uuidString
        type = 2
        width = image.size.width
        height = image.size.height
        uploadStatus = .uploading
    }
    
    init(image:UIImage,videoPath:String,videoSeconds:Double) {
        super.init()
        localImage = image
        localVideoUrl = videoPath
        content_key = UUID().uuidString
        type = 1
        duration = videoSeconds.int
        width = image.size.width
        height = image.size.height
        uploadStatus = .uploading
    }
    
}
